<?php

require("../config.php");
include_once("functii.php");

$coord_x1 = addentities($_GET['coord_x']);
$coord_y1 = addentities($_GET['coord_y']);

$query = mysql_query("SELECT * FROM planete WHERE coord_x = '".$coord_x1."' AND coord_y = '".$coord_y1."'");
 while ($rez = mysql_fetch_array($query)) {
 $nume_planeta = $rez["nume"];
 $utilizator = $rez["user"];
 $durata = '10';
 $distanta = returnare_data(calculare_distanta($coord_x, $coord_y, $coord_x1, $coord_y1, $durata), "0");
 $id_utilizator = valoare_mysql("SELECT id FROM users WHERE user = '".$utilizator."'");
 
 echo '<table border="0" cellpadding="0" cellspacing="0" class="font_2">';
 echo ' 	 <tr>';
 echo '		   <td><div style="width:50px; height:50px; padding: 10px;"><img src="img/planeta_1.gif" /></div></td>';
 echo '		   <td>Nume: <strong>'.$nume_planeta.'</strong><br>Utilizator: <a href="javascript:void(0)" onClick="javscript:optiuni_utilizator(\''.$id_utilizator.'\');">'.$utilizator.'</a><br>Distanta: '.$distanta.'</td>';
 echo '		 </tr>';
 echo '		 <tr>';
 echo '		   <td>Optiuni: </td>';
 echo '		   <td><a href="javascript:void(0)" onClick="javascript:optiuni_structura(\'16\', \'\')">Ataca</a> | <a href="javascript:void(0)" onClick="javascript:optiuni_structura(\'16\', \'\')">Spioneaza</a> | <a href="javascript:void(0)" onClick="javascript:optiuni_structura(\'16\', \'\')">Trimite intariri</a></td>';
 echo '		 </tr>';
 echo '</table>';
 }

mysql_close($db);

?>